export const login = (state,val)=>{
    localStorage.token = val.identitytoken
    state.token = val.identitytoken
    state.isLogin = true
}

export const setToken = (state,data)=>{
    state.token = data
}

export const logout = (state)=>{
    localStorage.removeItem('token')
    localStorage.removeItem("userName")
    localStorage.removeItem("userId")
    state.token = null
    state.isLogin = false
}

export const saveUserInfo = (state,val)=>{
    state.userInfo = val
}